package com.qf;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("movie")
@Document(indexName = "my_movie",shards = 2,replicas = 1)
public class Movie {

  @TableId(type = IdType.AUTO)
  @Id
  private Integer movieId;
  @Field(store = true,type = FieldType.Text ,analyzer = "ik_max_word",index = true)
  private String movieCh;
  @Field(store = true,type = FieldType.Text ,analyzer = "ik_max_word",index = true)
  private String movieEn;
  @Field(store = true,type = FieldType.Keyword ,index = false)
  private String image;
  @Field(store = true,type = FieldType.Integer ,index = false)
  private Integer movieTime;
  @Field(store = true,type = FieldType.Date ,index = false,format = DateFormat.date_time)
  private Date showTime;
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private String showPlace;
  @Field(store = false)
  @TableField(exist = false)
  private String content;
  @Field(store = false)
  private Integer movieNum;
  @Field(store = true,type = FieldType.Keyword ,index = true)
  @TableField(exist = false)
  private List<String> types;


  /*建立一个演员属性*/
  @TableField(exist = false)//字段注解（非主键）
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<Actor> actorsList;

  /*建立一个电影详情属性*/
  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private MovieDesc movieDesc;

  /*建立一个电影照片属性*/
  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<MoviePic> moviePicsList;

  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<String> acName;
  /*建立一个电影类型属性*/
  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<Type> typeList;

  /*建立一个用户类型属性*/
  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<User> userList;

  /*建立一个评论类型属性*/
  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)
  private List<Comment> commentList;

  @TableField(exist = false)
  @Field(store = true,type = FieldType.Keyword ,index = true)


  private int movieStatus;





}
